<?php


class VodAttributeValue extends CActiveRecord
{
	
	public static function model($Vgmajjibziuy=__CLASS__)
	{
		return parent::model($Vgmajjibziuy);
	}

	
	public function tableName()
	{
		return 'vod_attribute_value';
	}

	
	public function rules()
	{
		
		
		return array(
			array('vod_attribute_id, vod_asset_id', 'required'),
			array('vod_attribute_id, vod_asset_id, value_int', 'numerical', 'integerOnly'=>true),
			array('value_double', 'numerical'),
			array('value_datetime, value_varchar, create_date', 'safe'),
			
			
			array('id, vod_attribute_id, vod_asset_id, value_datetime, value_int, value_double, value_varchar, create_date', 'safe', 'on'=>'search'),
		);
	}

	
	public function relations()
	{
		
		
		return array(
			'vodAsset' => array(self::BELONGS_TO, 'VodAsset', 'vod_asset_id'),
			'vodAttribute' => array(self::BELONGS_TO, 'VodAttribute', 'vod_attribute_id'),
		);
	}

	
	public function attributeLabels()
	{
		return array(
			'id' => 'ID',
			'vod_attribute_id' => 'Vod Attribute',
			'vod_asset_id' => 'Vod Asset',
			'value_datetime' => 'Value Datetime',
			'value_int' => 'Value Int',
			'value_double' => 'Value Double',
			'value_varchar' => 'Value Varchar',
			'create_date' => 'Create Date',
		);
	}

	
	public function search()
	{
		
		

		$V0v5vsnfxezw=new CDbCriteria;

		$V0v5vsnfxezw->compare('id',$this->id);
		$V0v5vsnfxezw->compare('vod_attribute_id',$this->vod_attribute_id);
		$V0v5vsnfxezw->compare('vod_asset_id',$this->vod_asset_id);
		$V0v5vsnfxezw->compare('value_datetime',$this->value_datetime,true);
		$V0v5vsnfxezw->compare('value_int',$this->value_int);
		$V0v5vsnfxezw->compare('value_double',$this->value_double);
		$V0v5vsnfxezw->compare('value_varchar',$this->value_varchar,true);
		$V0v5vsnfxezw->compare('create_date',$this->create_date,true);

		return new CActiveDataProvider($this, array(
			'criteria'=>$V0v5vsnfxezw,
		));
	}
}